Pre-registered hypothesis:
Single women spend less time with male biological relatives during the FP (for paired women, we did not include questions about relative sex at this level of detail for reasons of length, but we would not make a different prediction).
All women spend less time with relatives during the FP (this question was asked for all participating women).
library(brms)
library(bayesplot)
model2_family <- brm(time_family ~ (premenstrual_phase_fab + menstruation + fertile_fab) * hormonal_contraception + (1 + fertile_fab | person), data = diary %>% filter(reasons_for_exclusion == "" | reasons_for_exclusion == "not_single, "), cores = 4, backend = "cmdstanr",file = "brms_fits/model2_family3")
hypothesis(model2_family, "fertile_fab < 0", alpha = 0.01)
## Hypothesis Tests for class b:
## Hypothesis Estimate Est.Error CI.Lower CI.Upper Evid.Ratio Post.Prob Star
## 1 (fertile_fab) < 0 -0.01 0.06 -0.15 0.13 1.26 0.56
## ---
## 'CI': 98%-CI for one-sided and 99%-CI for two-sided hypotheses.
## '*': For one-sided hypotheses, the posterior probability exceeds 99%;
## for two-sided hypotheses, the value tested against lies outside the 99%-CI.
## Posterior probabilities of point hypotheses assume equal prior probabilities.
hypothesis(model2_family, "fertile_fab:hormonal_contraceptionTRUE > 0", alpha = 0.01)
## Hypothesis Tests for class b:
## Hypothesis Estimate Est.Error CI.Lower CI.Upper Evid.Ratio Post.Prob Star
## 1 (fertile_fab:horm... > 0 0.07 0.12 -0.2 0.34 2.67 0.73
## ---
## 'CI': 98%-CI for one-sided and 99%-CI for two-sided hypotheses.
## '*': For one-sided hypotheses, the posterior probability exceeds 99%;
## for two-sided hypotheses, the value tested against lies outside the 99%-CI.
## Posterior probabilities of point hypotheses assume equal prior probabilities.
model2_family_curve <- brm(time_family ~ s(RCD_fab, by = hormonal_contraception, bs = "cc") + (1 | person), data = diary %>% filter(reasons_for_exclusion == "" | reasons_for_exclusion == "not_single, "), backend = "cmdstanr", cores = 4, file ="brms_fits/model3_family_curve")
curve_plot(model2_family_curve, "Time spent with family")
## Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, : invalid font type
sjPlot::tab_model(model2_family)
| time_family | ||
|---|---|---|
| Predictors | Estimates | CI (95%) |
| Intercept | 1.71 | 1.65 – 1.76 |
|
premenstrual_phase_fab: TRUE |
-0.01 | -0.06 – 0.03 |
| menstruation | 0.08 | 0.03 – 0.14 |
| fertile_fab | -0.01 | -0.13 – 0.11 |
|
hormonal_contraception: TRUE |
0.06 | -0.04 – 0.17 |
| premenstrual_phase_fabTRUE.hormonal_contraceptionTRUE | 0.06 | -0.04 – 0.15 |
| menstruation.hormonal_contraceptionTRUE | 0.00 | -0.11 – 0.11 |
| fertile_fab.hormonal_contraceptionTRUE | 0.08 | -0.16 – 0.30 |
| Random Effects | ||
| σ2 | 1.27 | |
| τ00 person | 0.24 | |
| τ11 person.fertile_fab | 0.48 | |
| ρ01 | ||
| ρ01 | ||
| ICC | 0.16 | |
| N person | 793 | |
| Observations | 24450 | |
| Marginal R2 / Conditional R2 | 0.002 / 0.158 | |
summary(model2_family)
## Family: gaussian
## Links: mu = identity; sigma = identity
## Formula: time_family ~ (premenstrual_phase_fab + menstruation + fertile_fab) * hormonal_contraception + (1 + fertile_fab | person)
## Data: diary %>% filter(reasons_for_exclusion == "" | rea (Number of observations: 24450)
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
## total post-warmup samples = 4000
##
## Group-Level Effects:
## ~person (Number of levels: 793)
## Estimate Est.Error l-99% CI u-99% CI Rhat Bulk_ESS Tail_ESS
## sd(Intercept) 0.49 0.02 0.45 0.54 1.00 2011 2789
## sd(fertile_fab) 0.69 0.06 0.54 0.84 1.00 1204 2107
## cor(Intercept,fertile_fab) -0.31 0.07 -0.47 -0.13 1.00 3488 3232
##
## Population-Level Effects:
## Estimate Est.Error l-99% CI u-99% CI Rhat Bulk_ESS
## Intercept 1.71 0.03 1.64 1.78 1.00 2155
## premenstrual_phase_fabTRUE -0.01 0.03 -0.08 0.05 1.00 5308
## menstruation 0.08 0.03 0.01 0.16 1.00 6070
## fertile_fab -0.01 0.06 -0.17 0.15 1.00 4801
## hormonal_contraceptionTRUE 0.06 0.05 -0.07 0.20 1.00 2318
## premenstrual_phase_fabTRUE:hormonal_contraceptionTRUE 0.06 0.05 -0.07 0.18 1.00 5131
## menstruation:hormonal_contraceptionTRUE 0.00 0.06 -0.15 0.16 1.00 5411
## fertile_fab:hormonal_contraceptionTRUE 0.07 0.12 -0.24 0.37 1.00 4271
## Tail_ESS
## Intercept 3115
## premenstrual_phase_fabTRUE 3246
## menstruation 3577
## fertile_fab 3520
## hormonal_contraceptionTRUE 3016
## premenstrual_phase_fabTRUE:hormonal_contraceptionTRUE 3348
## menstruation:hormonal_contraceptionTRUE 3506
## fertile_fab:hormonal_contraceptionTRUE 3671
##
## Family Specific Parameters:
## Estimate Est.Error l-99% CI u-99% CI Rhat Bulk_ESS Tail_ESS
## sigma 1.13 0.01 1.11 1.14 1.00 5864 2978
##
## Samples were drawn using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(model2_family)
custom_forest(model2_family, pars = "fertile_fab") +
theme(axis.text.y = element_blank()) +
geom_hline(yintercept = 0, linetype = 'dashed', size = 1, color = "black") +
theme(axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.position = c(0,1),
legend.justification = c(0,1)) +
facet_null() +
ylab("") +
scale_y_continuous("Est. fertile phase effect + 80% CI", breaks = -2:2)